import { createApp, App, DefineComponent, ComponentPublicInstance } from "vue";
import inject from "@/inject";
import router from "@/router";
import { store, key } from "@/store";
export class VueMountModel {
    VueComponent: App;
    vm: ComponentPublicInstance;
    constructor(
        ComponentTemplate: DefineComponent<{}, {}, any>) {
        this.VueComponent = this.createAppCustom(ComponentTemplate);
        this.vm = this.VueComponent.mount(document.createElement("div"));
    }

    createAppCustom(ComponentTemplate: DefineComponent<{}, {}, any>): App {
        return createApp(ComponentTemplate)
            .use(store, key)
            .use(router)
            .use(inject);
    }
}
